<?php if(!empty($guards[Employe::ENGINEER])) :?>
<h2>GARDES DES INGENIEURS</h2>
	<table aling="center"  cellspacing="0" cellpadding="0">
		<thead>
			<tr><th>Date</th><th>Nom et Prénom</th><th>Service</th><th>Adresse</th><th>Téléphone</th></tr>
		</thead>
        <tbody>
        	<?php $i=0; foreach($guards[Employe::ENGINEER] as $guard):?>
                <tr >
                	<td  <?php echo ($i % 2==0 ? 'style="background-color:#F6FFD9"; padding:10px 0' : '') ?> >
                        <strong><?php echo $guard->unit_type == GuardUnit::WEEKEND ? 'Week-end' : $guard->unit_label ?></strong>
                        <br />
                        Du <?php echo date('d/m/Y', strtotime($guard->start_date)) ?>
                        Au <?php echo date('d/m/Y', strtotime($guard->end_date)) ?>
                    </td>
                    <td <?php echo ($i % 2==0 ? 'style="background-color:#F6FFD9"' : '') ?>><?php echo $guard->first_name.' '.$guard->last_name?></td>
                    <td <?php echo ($i % 2==0 ? 'style="background-color:#F6FFD9"' : '') ?>><?php echo ucfirst($guard->service_name)?></td>
                    <td <?php echo ($i % 2==0 ? 'style="background-color:#F6FFD9"' : '') ?>><?php echo $guard->adresse?></td>
                    <td <?php echo ($i++ % 2==0 ? 'style="background-color:#F6FFD9"' : '') ?>>Bureau: <?php echo $guard->tele_bureau?><br />GSM: <?php echo $guard->gsm?></td>
                </td>
                </tr>
            <?php endforeach ?>
        </tbody>
	</table>
<?php endif ?>

<?php if(!empty($guards[Employe::AGENT])) :?>
<h2>GARDES DES AGENTS</h2>
	<table aling="center"  cellspacing="0" cellpadding="0">
		<thead>
			<tr><th>Date</th><th>Nom et Prénom</th><th>Service</th><th>Adresse</th><th>Téléphone</th></tr>
		</thead>
        <tbody>
        	<?php foreach($guards[Employe::AGENT] as $guard):?>
                <tr>
                	<td>
                        <strong>Semaine</strong>
                        <br />
                        Du <?php echo date('d/m/Y', strtotime($guard->start_date)) ?>
                        Au <?php echo date('d/m/Y', strtotime($guard->end_date)) ?>
                    </td>
                    <td><?php echo $guard->first_name.' '.$guard->last_name?></td>
                    <td><?php echo ucfirst($guard->service_name)?></td>
                    <td><?php echo $guard->adresse?></td>
                    <td>Bureau: <?php echo $guard->tele_bureau?><br />GSM: <?php echo $guard->gsm?></td>
                </tr>
            <?php endforeach ?>
        </tbody>
	</table>
<?php endif ?>
